package com.ruoyi.boat.service.impl;

import java.util.Date;
import java.util.List;

import com.ruoyi.boat.aop.MyDataScope;
import com.ruoyi.boat.aop.SQLFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.boat.mapper.RadarDataMapper;
import com.ruoyi.boat.domain.RadarData;
import com.ruoyi.boat.service.IRadarDataService;
import com.ruoyi.common.core.text.Convert;

/**
 * 测风雷达数据Service业务层处理
 *
 * @author ruoyi
 * @date 2023-08-09
 */
@Service
public class RadarDataServiceImpl implements IRadarDataService {
    @Autowired
    private RadarDataMapper radarDataMapper;

    /**
     * 查询测风雷达数据
     *
     * @param id 测风雷达数据主键
     * @return 测风雷达数据
     */
    @Override
    public RadarData selectRadarDataById(Long id) {
        return radarDataMapper.selectRadarDataById(id);
    }

    @Override
    public RadarData selectRadarDataByBoatCodeAndCreateTime(Date createTime,String boatCode) {
        return radarDataMapper.selectRadarDataByCreateTime(createTime,boatCode);
    }

    /**
     * 查询测风雷达数据列表
     *
     * @param radarData 测风雷达数据
     * @return 测风雷达数据
     */
    @Override
    @MyDataScope
    @SQLFilter
    public List<RadarData> selectRadarDataList(RadarData radarData) {
        return radarDataMapper.selectRadarDataList(radarData);
    }

    /**
     * 新增测风雷达数据
     *
     * @param radarData 测风雷达数据
     * @return 结果
     */
    @Override
    public int insertRadarData(RadarData radarData) {
        return radarDataMapper.insertRadarData(radarData);
    }

    /**
     * 修改测风雷达数据
     *
     * @param radarData 测风雷达数据
     * @return 结果
     */
    @Override
    public int updateRadarData(RadarData radarData) {
        return radarDataMapper.updateRadarData(radarData);
    }

    /**
     * 批量删除测风雷达数据
     *
     * @param ids 需要删除的测风雷达数据主键
     * @return 结果
     */
    @Override
    public int deleteRadarDataByIds(String ids) {
        return radarDataMapper.deleteRadarDataByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除测风雷达数据信息
     *
     * @param id 测风雷达数据主键
     * @return 结果
     */
    @Override
    public int deleteRadarDataById(Long id) {
        return radarDataMapper.deleteRadarDataById(id);
    }
}
